# Contributor: Matthias Ahouansou <matthias@ahouansou.cz>
# Maintainer: Matthias Ahouansou <matthias@ahouansou.cz>
pkgname=empede
pkgver=0.2.3
pkgrel=0
pkgdesc="A web client for MPD written in Rust"
url="https://git.sijman.nl/_/empede"
# loongarch64: blocked by libc crate
arch="all !loongarch64"
license="MIT"
makedepends="
	cargo
	cargo-auditable
"
install="empede.pre-install"
subpackages="$pkgname-openrc $pkgname-doc"
source="
	$pkgname-$pkgver.tar.gz::https://git.sijman.nl/_/empede/archive/v$pkgver.tar.gz
	empede.initd
	empede.confd
"
builddir="$srcdir/$pkgname"
options="net !check" # no tests

prepare() {
	default_prepare
	cargo fetch --target="$CTARGET" --locked
}

build() {
	cargo auditable build --release --frozen
}

package() {
	install -Dm 755 target/release/empede "$pkgdir"/usr/bin/empede
	mkdir -p "$pkgdir"/usr/lib/empede
	cp -af static templates -t "$pkgdir"/usr/lib/empede

	install -Dm 644 LICENSE.md "$pkgdir"/usr/share/licenses/"$pkgname"/LICENSE.md

	install -Dm 755 "$srcdir"/empede.initd "$pkgdir"/etc/init.d/empede
	install -Dm 644 "$srcdir"/empede.confd "$pkgdir"/etc/conf.d/empede
}

sha512sums="
9683716fa8b9e0b950790f081f3fc74686af5b90b014f7e50f17bd56f1af8a1b86611142b66abb7d89ef52e29603b8763723d6b8ed094805a64aad8aaa46a11d  empede-0.2.3.tar.gz
a241ecc998a2d891008766b6c8cc636e904b9450a50ed3c965adb9f6d304cd205f7c45992761c3ee6a207a68d2b004a617bf7875194294e07bca7ff3c16e8e1d  empede.initd
4bcb3b089cd8c7c552e401ed9bc3da4ce631aa22d891b7ae0fa6d268921aeeddeee5951ae7655bdb155eda823f7886a2d644d762f4d48e80e8a5d0ccad063314  empede.confd
"
